package com.Ajava1801D.并发包.CountDownLunch;

import java.util.LinkedList;
import java.util.concurrent.CountDownLatch;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/7  15:18
 * 描述:
 */
public class TestCountLanch2222 {

    public static void main(String[] args) throws InterruptedException {

        CountDownLatch countDownLatch=new CountDownLatch(3);

        Thread t1=new Thread(new TestRun2222(countDownLatch,2),"A");
        Thread t2=new Thread(new TestRun2222(countDownLatch,5),"D");
        Thread t3=new Thread(new TestRun2222(countDownLatch,3),"E");

        t1.start();
        t2.start();
        t3.start();

        countDownLatch.await();
        System.out.println("==========OK了，可以 吃了======1===");

        CountDownLatch countDownLatch1=new CountDownLatch(3);

        Thread t11=new Thread(new TestRun2222(countDownLatch1,2),"A");
        Thread t22=new Thread(new TestRun2222(countDownLatch1,5),"D");
        Thread t33=new Thread(new TestRun2222(countDownLatch1,3),"E");

        t11.start();
        t22.start();
        t33.start();

        countDownLatch1.await();

        System.out.println("==========OK了，可以 吃了======2===");

        new LinkedList();


    }

}
